home *** CD-ROM | disk | FTP | other *** search
- FFREAD(3C) Last changed: 3-5-98
-
-
- NNAAMMEE
- ffffrreeaadd, ffffwwrriittee, ffffwweeooff, ffffwweeoodd, ffffrreeaaddff, ffffwwrriitteeff, ffffwweeooddff, ffffwweeooffff,
- fffffflluusshh - Provides flexible file I/O
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ffffiioo..hh>>
-
- UNICOS and UNICOS/mk systems:
-
- iinntt ffffrreeaadd ((iinntt _f_d,, vvooiidd **_b_u_f,, ssiizzee__tt _n_b [[,, ssttrruucctt ffffssww **_s_t_a_t [[,,
- iinntt _f_u_l_p [[,, iinntt **_u_b_c]]]]]]));;
-
- iinntt ffffwwrriittee ((iinntt _f_d,, ccoonnsstt vvooiidd **_b_u_f,, ssiizzee__tt _n_b [[,, ssttrruucctt ffffssww
- **_s_t_a_t [[,, iinntt _f_u_l_p [[,, iinntt **_u_b_c]]]]]]));;
-
- iinntt ffffwweeooff ((iinntt _f_d [[,, ssttrruucctt ffffssww **_s_t_a_t]]));;
-
- iinntt ffffwweeoodd ((iinntt _f_d [[,, ssttrruucctt ffffssww **_s_t_a_t]]));;
-
- iinntt fffffflluusshh ((iinntt _f_d [[,, ssttrruucctt ffffssww **_s_t_a_t]]));;
-
- IRIX systems:
-
- ssssiizzee__tt ffffrreeaadd ((iinntt _f_d,, vvooiidd **_b_u_f,, ssiizzee__tt _n_b));;
-
- ssssiizzee__tt ffffwwrriittee ((iinntt _f_d,, ccoonnsstt vvooiidd **_b_u_f,, ssiizzee__tt _n_b));;
-
- iinntt ffffwweeooff ((iinntt _f_d));;
-
- iinntt ffffwweeoodd ((iinntt _f_d));;
-
- iinntt fffffflluusshh ((iinntt _f_d));;
-
- All systems:
-
- ssiizzee__tt ffffrreeaaddff ((iinntt _f_d,, vvooiidd **_b_u_f,, ssiizzee__tt _n_b ,, ssttrruucctt ffffssww **_s_t_a_t,,
- iinntt _f_u_l_p,, iinntt **_u_b_c));;
-
- ssiizzee__tt ffffwwrriitteeff ((iinntt _f_d,, ccoonnsstt vvooiidd **_b_u_f,, ssiizzee__tt _n_b ,, ssttrruucctt ffffssww
- **_s_t_a_t,, iinntt _f_u_l_p,, iinntt **_u_b_c));;
-
- iinntt ffffwweeooffff ((iinntt _f_d,, ssttrruucctt ffffssww **_s_t_a_t));;
-
- iinntt ffffwweeooddff ((iinntt _f_d,, ssttrruucctt ffffssww **_s_t_a_t));;
-
- iinntt fffffflluusshh ((iinntt _f_d,, ssttrruucctt ffffssww **_s_t_a_t));;
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- The ffffrreeaadd and ffffwwrriittee functions provide flexible file I/O (FFIO) to
- record-oriented or byte stream-oriented data in an
- application-transparent manner.
-
- Function ffffwweeooff writes an end-of-file (EOF) if the function is
- supported for the layer in use.
-
- Function ffffwweeoodd writes an end-of-data (EOD). If the FFIO
- specification is stream oriented, this requests truncation of the file
- at the current position.
-
- Function fffffflluusshh instructs the layer to flush as much data to the file
- as is convenient. For some layers, and layers which do no buffering
- (for example, the ssyyssccaallll layer), this operation does nothing. For
- record layers, the fffffflluusshh function will not terminate any partially-
- written records. This function is intended for use on files which are
- being written. It is undefined for files which are being read.
-
- The arguments are as follows:
-
- _f_d Number returned by ffffooppeenn(3C).
-
- _b_u_f Pointer to the user data buffer.
-
- _n_b Requested number of bytes to be read or written.
-
- _s_t_a_t Pointer to the returned status structure.
-
- _f_u_l_p Either FFUULLLL or PPAARRTTIIAALL (defined in header file ffffiioo..hh);
- indicates whether I/O should be performed in full or partial
- record mode.
-
- _u_b_c Unused bit count. The word pointed to by this pointer is in
- the range of 0 through 7; it is used to specify how many bits
- in the last byte are not valid data.
-
- The _n_b and _u_b_c arguments are used together to determine an exact
- number of bits to be transferred. _n_b always indicates the number of
- bytes affected by the data transfer, even if only one bit is
- transferred in that byte.
-
- If argument _u_b_c is omitted, it is assumed to be 0.
-
- If _u_b_c is specified, it functions as both an input and output
- argument. It is passed to ffffrreeaadd or ffffwwrriittee as a request to omit
- processing the specified number of bits in the last byte of the
- request. For example, to read 2 bits from a file, you should set _n_b
- to 1, set the word at _u_b_c to 6, and call ffffrreeaadd. On completion of the
- ffffrreeaadd request, the word pointed to by _u_b_c is set by ffffrreeaadd to
- indicate the number of unused bits in the last byte read. As in the
- preceding example, if only one bit were available to be read, then the
- word at _u_b_c would be set to 7 by ffffrreeaadd.
-
- For ffffwwrriittee, _u_b_c is an input argument specifying the number of bits in
- the last byte transferred that should not be written to the file.
- Function ffffwwrriittee normally will not change the value of the word at
- _u_b_c, because, if the specified number of bits is not written, an error
- is returned.
-
- RREETTUURRNN VVAALLUUEESS
- Upon successful completion, a non-negative value is returned.
- Otherwise, -1 is returned and, if the _s_t_a_t argument is passed, the
- error value is found in ssttaatt..ssww__eerrrroorr. If the _s_t_a_t parameter is not
- provided, the error code is found in eerrrrnnoo.
-
- If the ssttaatt parameter is passed, the ssww__ssttaatt field is set to one of
- the following values, indicating the condition that terminated the
- operation:
-
- VVaalluuee DDeessccrriippttiioonn
-
- FFFFEERRRR An error was encountered.
-
- FFFFEEOORR An end-of-record (EOR) was encountered.
-
- FFFFEEOOFF An end-of-file (EOF) was encountered.
-
- FFFFEEOODD An end-of-data (EOD) was encountered.
-
- FFFFCCNNTT For layers without record handling, some data was read before
- an EOF or EOD was encountered.
-
- For layers with record handling, the count was satisfied
- before an EOR was encountered. If the count was satisfied
- simultaneously with encountering an EOR, the FFFFEEOORR status is
- returned.
-
- The FFFFSSTTAATT macro, defined in ffffiioo..hh, can be used to obtain the value
- of the ssww__ssttaatt field.
-
- SSEEEE AALLSSOO
- ffffooppeenn(3C), ffffsseeeekk(3C)
-
- aassggccmmdd(1)
-
- _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _I/_O _G_u_i_d_e, publication SG-2168
-
- _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication
- SR-2165, for the printed version of this man page.
-